namespace IQIGame.Onigao.GamePlay
{
    public abstract class LevelPlaySubBaseCtrl : TModuleController
    {
        protected LevelPlayController levelPlayCtrl => regionCtrl.levelPlayCtrl;
        protected LevelPlayRegionController regionCtrl => FindRegionCtrl();

        private LevelPlayRegionController FindRegionCtrl()
        {
            var p = parent;
            while (p != null && p is not LevelPlayRegionController)
            {
                p = p.parent;
            }
            return p as LevelPlayRegionController;
        }
    }
}
